﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>自定义动画1</title>
    <style>
        *{margin: 0; padding: 0;}
        .box{
            width: 250px;
            position:absolute;
            left: -250px;
            height: 350px;
        }
        .box .content{
            width: 250px;
            height: 350px;
            background: #f60;
        }
        .box span{
            position: absolute;
            width: 25px;
            padding: 5px 10px;
            color: #fff;
            background: #333;
            top: 50%;
            margin-top: -28px;
            right: -45px;
            text-align: center;
            cursor: pointer;
            border-radius: 0 8px 8px 0;
        }
    </style>
</head>
<body>
<div class="box">
    <div class="content">
        11111111
    </div>
    <span>分享到</span>
</div>
</body>
</html>
<script src="js/jquery-1.10.1.js"></script>
<script>
    $(function () {
        $(".box").hover(function () {
            $(".box").animate({
                left : 0
            })
        },function () {
            $(".box").stop(true,false).animate({
                left : "-250px"
            })
        })
    })
</script>